<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css" />
    <link rel="stylesheet" type="text/css" href="../../../ht-css/jedate.css" />
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css" />
    <link rel="stylesheet" href="../../../lib/select2-4.0.3/dist/css/select2.min.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>退货管理</title>
    <style>
        .select2-container{
            width: 41% !important;
            float: left;
            margin-left: 10px;
            text-align: left;
        }
    </style>
</head>
<body data-id="511">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>渠道售后管理<span
        class="c-gray en">&gt;</span>退货管理<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                            href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav><article class="page-container">
    <div class="ml-20 mr-20">
        <div class="bg-1 bk-gray pb-10">
            <form id="form-search">
                <div class="pl-10 lh-30 mb-10">
                    <table class="table-hover table_li ml-10 mb-10 table">
                        <thead class="text-l">
                        </thead>
                    </table>
                    <div class="line mb-10"></div>
                    <table class="table-hover table_li ml-10 mb-10 table">
                        <thead class="text-l">
                        <tr>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label  class="form-label f-l w-99 text-r lh-26" style="margin-left: -9px;">选择渠道商：</label>
                                    <select id="ascription_lsit" class="select radius f-l ml-10" name="brandclass" size="1" style="width:41%; height: 30px;">
                                        <script id="ascription_bob" type="text/x-dot-template">
                                            <option value="" selected>全部</option>
                                            {{if( it && it.length>0 ){ }}
                                            {{ for(var i=0; i< it.length; i++) { }}
                                            <option value="{{=it[i].customerCode}}">{{=it[i].customerName}}</option>
                                            {{ } }}
                                            {{ }else{ }}
                                            <option>没有数据</option>
                                            {{ } }}
                                        </script>
                                    </select>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l pt-5">&nbsp;申请编号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text radius" style="width: 182px;margin-left: -123px;"  id="applyCode" name="applyCode" placeholder="输入申请编号查询" datatype="n0-9" errormsg="格式错误，请重新输入" ignore="ignore" onkeyup="this.value=this.value.replace(/\s+/g,'')">
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 81px;" class="form-label f-l pt-5">对方订单号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text radius" style="width: 200px;margin-left: -109px;"  id="dorderCode" name="orderCode" placeholder="输入订单号查询" >
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 84px;" class="form-label f-l pt-5">我方订单号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text radius" style="width: 200px;margin-left: -116px;"  id="orderCode" name="worderCode" placeholder="输入订单号查询" onkeyup="this.value=this.value.replace(/[^A-Z0-9]/g,'')" errormsg="格式错误，请重新输入" ignore="ignore" >
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </div>
                            </td>

                        </tr>
                        <tr>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 93px;" class="form-label f-l pt-5">类型：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width: 41%;margin-left: -18px;">
                              <select class="select" name="applyType" id="applyType" size="1">
                                <option value="" selected>选择类型</option>
                                <option value="10">拒收</option>
                                <option value="11">拒收-拦截</option>
                                <option value="20">退货</option>
                              </select>
                              </span>
                                </div>
                            </td>

                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 103px;" class="form-label f-l pt-5">&nbsp;&nbsp;&nbsp;状&nbsp;态&nbsp;：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width:41%;margin-left: -12px;">
                              <select class="select" name="dealState" id="dealState" size="1">
                                <option value="" selected>选择状态</option>
                                <option value="10">待审核</option>
                                <!--<option value="20">已受理</option>-->
                                <option value="30">退货处理</option>
                                <option value="40">退款处理</option>
                                <option value="50">已完成</option>
                                <option value="60">已关闭</option>
                              </select>
                              </span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width:117px;" class="form-label f-l pt-5">&nbsp;&nbsp;原因：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width:41%;margin-left: -27px;">
                                      <select class="select" name="reason" id="reason" size="1">
                                        <option value="" selected>请选择退货原因</option>
                                         <option value="10">商品质量问题</option>
                                         <option value="12">收到商品与网站展示不符(颜色、图片、规格、产地及详情描述)</option>
                                         <option value="50">商品发错/少发/漏发</option>
                                         <option value="13">客户原因无理由退货</option>
                                         <option value="100">未按约定时间发货</option>
                                         <option value="80">到货物流破损</option>
                                         <option value="70">多买/买错不想要了</option>
                                         <option value="14">资质问题</option>
                                         <option value="90">发票问题</option>
                                         <option value="11">其他原因</option>
                                      </select>
                                      </span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                        	<td class="col-3-1">
                                <div class="row ml-10">
                                    <label class="form-label f-l pt-5" style="width: 74px">申请时间：</label>
                                    <div class="f-l">
                                        <input class="workinput wicon input-text radius" id="applyTimeMin" type="text" placeholder="起始时间" style="width: 115px;margin-left: 1px;" readonly>
                                        ~
                                        <input class="workinput wicon input-text radius" id="applyTimeMax" type="text" placeholder="结束时间" style="width:115px;" readonly>
                                    </div>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 101px;" class="form-label f-l pt-5">审核时间：</label>
                                    <div class="f-l">
                                        <input class="workinput wicon input-text radius" id="checkTimeMin" type="text" placeholder="起始时间" style="width:115px;margin-left: -7px;">
                                        ~
                                        <input class="workinput wicon input-text radius" id="checkTimeMax" type="text" placeholder="结束时间" style="width:115px;">
                                    </div>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 102px;" class="form-label f-l pt-5">&nbsp;审&nbsp;核&nbsp;人：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text radius"  style="width: 200px;margin-left: -155px;" id="checker" name="checker"  placeholder="输入姓名关键字" datatype="/^[^a-zA-Z1-9]{0,20}$/" errormsg="格式错误，请重新输入" ignore="ignore" onkeyup="this.value=this.value.replace(/\s+/g,'')">
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </div>
                            </td>
                        </tr>
                        <tr>

                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style=" width: 71px;" class="form-label f-l pt-5">&nbsp;销售经理：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text radius" style="width: 183px;margin-left: -135px;"  id="saleManager" name="saleManager"  placeholder="输入姓名关键字" datatype="/^[^a-zA-Z1-9]{0,20}$/" errormsg="格式错误，请重新输入" ignore="ignore" onkeyup="this.value=this.value.replace(/\s+/g,'')">
                                    </div>
                                    <span class="Validform_checktip"></span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 118px;" class="form-label f-l pt-5">发货仓：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width: 40%;margin-left: -24PX;">
                              <select class="select" name="brandclass" id="shippingWarehouse" size="1">
                                <option value="" selected>请选择发货仓</option>

                              </select>
                              </span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 112px" class="form-label f-l pt-5">&nbsp;&nbsp;收货地：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width:28%;margin-left: -19px;">
                                  <select class="select" onchange="discountdata(1)" name="brandclass" id="getArea" size="1">
                                    <option value="" selected>请选择收货区域</option>
                                  </select>
                                </span>
                                    <span class="select-box size-M radius col-xs-8" style="width:40%">
                                  <select class="select" name="brandclass" id="getPlace" size="1">
                                    <option value="" selected>请选择收货位置</option>
                                  </select>
                                </span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                 <label style="width: 89px;" class="form-label f-l pt-5">来&nbsp;源&nbsp;：</label>
                                 <span class="select-box size-M radius col-xs-8" style="width:41%;margin-left: -12px;">
                              <select class="select" name="dealState" id="channelSource" size="1">
                                <option value="" selected>全部</option>
                                <option value="10">渠道发起</option>
                                <option value="20">线下发起</option>
                                <option value="30">客服发起</option>
                              </select>
                              </span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label style="width: 103px;" class="form-label f-l pt-5">&nbsp;&nbsp;是否异常：</label>
                                    <span class="select-box size-M radius col-xs-8" style="width:41%;margin-left: -12px;">
                              <select class="select" name="dealState" id="isRefundAbnormal" size="1">
                                <option value="" selected>全部</option>
                                <option value="1">异常</option>
                                <option value="0">正常</option>
                              </select>
                              </span>
                                </div>
                            </td>
                            <td class="col-3-1">
                                <div class="row ml-10">
                                    <label  class="form-label f-l w-150 text-r lh-26">&nbsp;&nbsp;是否查询可关联售后单：</label>
                                    <div class="formControls f-l w-250">
                                        <select class=" select radius f-l w-250" style="height: 28px" size="1" id="isRelated">
                                            <option value="" selected>请选择</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div style="padding-left: 10px;padding-top: 20px">
                    <a class="btn btn-secondary radius size-S ml-10" id="putout" onclick="simpleExportForRefund()">简版导出</a>
                    <a class="btn btn-secondary radius size-S ml-10" id="putout1" onclick="complexExportForRefund()">详版导出</a>
                </div>
                <div class="text-c pb-20 pt-10">
                    <input type="submit"  class="btn btn-secondary radius size-S powerButton 627"  value="搜&nbsp;&nbsp;索">
                    <input name="" type="reset" onclick="resetDiv()" class="btn radius size-S ml-10 powerButton 627" value="重&nbsp;&nbsp;置">
                </div>
            </form>
            <table class="table table-border table-bg table-hover table-sort mt-10" id="datatable">
                <thead>
                <tr class="text-c">
                    <th width="50">申请单号</th>
                    <th width="50">对方订单号</th>
                    <th width="50">我方订单号</th>
                    <th width="50">类型</th>
                    <th width="60">申请日期</th>
                    <th width="60">审核日期</th>
                    <th width="60">发货人</th>
                    <th width="60">状态</th>
                    <th width="60">操作</th>
                </tr>
                </thead>
                <tbody class="shun">
                </tbody>
            </table>
            <div class="dataTables_wrapper goods_fanye clearfix mt-5">
                <div class="f-r pageturning M-box3"></div>
            </div>
        </div>
    </div>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/jquery.jedate.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/warehouse.js?rev=@@hash"></script>
<script src="../../../ht-js/Project.js?rev=@@hash"></script>
<!--引入分页-->
<link rel="stylesheet" href="../../../lib/pagination/pagination.css">
<script src="../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script src="../../../ht-js/dockingplatform/channelaftersale/afterSale-return.js?rev=@@hash"></script>
<!--权限控制-->
<script type="text/javascript" src="../../../ht-js/power.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/select2-4.0.3/dist/js/select2.full.min.js"></script>
<script>
    $(function(){
        $("#form-search").Validform({
            tiptype:2,
            callback:function(form){
                getList(1);
                return false;
            }
        });
        $('#ascription_lsit').select2({});
    })
    function timeSet(startEl,endEl,timeFormat){
        /*startEl=>开始时间Input的id，endEl=>结束时间Input的id，时间格式（YYYY-MM-DD hh:mm:ss  YYYY年MM月DD日 hh:mm:ss）*/
        /*时间设置*/
        var thisMaxTime = $.nowDate().substring(0,$.nowDate().length-8)+"23:59:59";
        var start = {
            format: timeFormat,
            maxDate: thisMaxTime,
            okfun: function(obj){
                end.minDate = obj.val.substring(0,obj.val.length-5)+"00:00:00"; //开始日选好后，重置结束日的最小日期
            }
        };
        var end = {
            format: timeFormat,
            maxDate: thisMaxTime,
            okfun: function(obj){
                start.maxDate = obj.val.substring(0,obj.val.length-5)+"23:59:59"; //将结束日的初始值设定为开始日的最大日期
            }
        };
        $.jeDate(startEl,start);
        $.jeDate(endEl,end);
    }
    timeSet("#applyTimeMin","#applyTimeMax","YYYY-MM-DD hh:mm");
    timeSet("#checkTimeMin","#checkTimeMax","YYYY-MM-DD hh:mm");
    function simpleExportForRefund(){
        if ($('#ascription_lsit option:selected') .val()=="" || $('#ascription_lsit option:selected') .val()==null || $('#ascription_lsit option:selected') .val()==undefined){
            layer.msg("请选择渠道商");
            $('#putout').attr('href',"#")
        }else{
            var pageNum=1;
            var pageSize=50;
            var customerCode=$("#ascription_lsit").val(); //渠道商id
            var refundId=$("#applyCode").val();// 申请编号
            var channelOrderId=$("#dorderCode").val();//对方单号
            var orderId=$("#orderCode").val();//我方单号
            var refundSource=$("#applyType").val();//退款方式
            var createdAtBegin=$("#applyTimeMin").val();// 申请开始时间
            var createdAtEnd=$("#applyTimeMax").val();// 申请结束时间
            var parentWarehouseId=$("#shippingWarehouse option:selected").val();// 仓库id
            var refundStatus=$("#dealState").val();//退货状态
            var refundReason=$("#reason").val();//申请原因
            var auditTimeBegin=$("#checkTimeMin").val();// 审核起始时间
            var auditTimeEnd=$("#checkTimeMax").val();// 审核终止时间
            var salesManagerName=$("#saleManager").val();// 销售经理名称
            var auditPersonName=$("#checker").val();// 审核人
            var province=$("#getArea").val();// 一级收货地（收货区域）
            var city=$("#getPlace").val();// 二级收货地（收货位置）

            // };
            $('#putout').attr('href',root.dockingplatform.exportRefundOrderExcel
                + '?customerCode=' + '' + customerCode+ '&refundId=' + '' + refundId+ '&channelOrderId=' + '' + channelOrderId+ '&orderId=' + '' + orderId
                + '&refundSource=' + '' + refundSource+ '&createdAtBegin=' + '' + createdAtBegin+ '&createdAtEnd=' + '' + createdAtEnd+ '&parentWarehouseId=' + '' + parentWarehouseId
                + '&refundStatus=' + '' + refundStatus+ '&refundReason=' + '' + refundReason+ '&auditTimeBegin=' + '' + auditTimeBegin+ '&auditTimeEnd=' + '' + auditTimeEnd
                + '&receiverProvince=' + '' + province+ '&receiverCity=' + '' + city+ '&pageNum=' + '' + pageNum+ '&pageSize=' + '' + pageSize
                + '&salesManagerName=' + '' + salesManagerName+ '&auditPersonName=' + '' + auditPersonName+ '&province=' + '' + province
                + '&city=' + '' + city)
        }

    }

    function complexExportForRefund(){
        if ($('#ascription_lsit option:selected') .val()==""){
            layer.msg("请选择渠道商");
            $('#putout1').attr('href',"#")
        }else{
            var pageNum=1;
            var pageSize=50;
            var customerCode=$("#ascription_lsit").val(); //渠道商id
            var refundId=$("#applyCode").val();// 申请编号
            var channelOrderId=$("#dorderCode").val();//对方单号
            var orderId=$("#orderCode").val();//我方单号
            var refundSource=$("#applyType").val();//退款方式
            var createdAtBegin=$("#applyTimeMin").val();// 申请开始时间
            var createdAtEnd=$("#applyTimeMax").val();// 申请结束时间
            var parentWarehouseId=$("#shippingWarehouse option:selected").val();// 仓库id
            var refundStatus=$("#dealState").val();//退货状态
            var refundReason=$("#reason").val();//申请原因
            var auditTimeBegin=$("#checkTimeMin").val();// 审核起始时间
            var auditTimeEnd=$("#checkTimeMax").val();// 审核终止时间
            var salesManagerName=$("#saleManager").val();// 销售经理名称
            var auditPersonName=$("#checker").val();// 审核人
            var province=$("#getArea").val();// 一级收货地（收货区域）
            var city=$("#getPlace").val();// 二级收货地（收货位置）

            // };
            $('#putout1').attr('href',root.dockingplatform.exportRefundOrderItemExcel
                + '?customerCode=' + '' + customerCode+ '&refundId=' + '' + refundId+ '&channelOrderId=' + '' + channelOrderId+ '&orderId=' + '' + orderId
                + '&refundSource=' + '' + refundSource+ '&createdAtBegin=' + '' + createdAtBegin+ '&createdAtEnd=' + '' + createdAtEnd+ '&parentWarehouseId=' + '' + parentWarehouseId
                + '&refundStatus=' + '' + refundStatus+ '&refundReason=' + '' + refundReason+ '&auditTimeBegin=' + '' + auditTimeBegin+ '&auditTimeEnd=' + '' + auditTimeEnd
                + '&receiverProvince=' + '' + province+ '&receiverCity=' + '' + city+ '&pageNum=' + '' + pageNum+ '&pageSize=' + '' + pageSize
                + '&salesManagerName=' + '' + salesManagerName+ '&auditPersonName=' + '' + auditPersonName+ '&province=' + '' + province
                + '&city=' + '' + city)
        }
    }


</script>
</body>
</html>